package exercise.day05;

public class Array {
    public static void main(String[] args) {
        int a1[]=new int[5];
        int[] a2={1,2,3};
        int[] a3=new int[]{1,2,3};
        int[] a4;
        a4=new int[]{1,2,3};

        double b1[]=new double[5];
        double b2[]=new double[]{1,2,3};
        double b3[]={1,2,3};
        double b4[];
        b4=new double[]{1,2,3};
        boolean[] c1=new boolean[5];
        boolean[] c2=new boolean[]{false,false,true};
        boolean[] c3={false,false,true};
        boolean[] c4;
        c4=new boolean[]{false,false,true};

        int arr[]=new int[3];
        arr[0]=10;
        arr[1]=10;
        arr[2]=1000;
        System.out.println(arr.length);//arr的长度
        System.out.println(arr[arr.length-1]);//输出arr最后一个数

        double arr1[]=new double[3];
        arr1[0]=1;
        arr1[1]=3;
        arr1[2]=5;
        System.out.println(arr1.length);//arr1的长度
        System.out.println(arr1[arr1.length-1]);//输出arr1最后一个数

        boolean[] arr3=new boolean[5];
        arr3[0]=false;
        arr3[1]=false;
        arr3[3]=true;
        arr3[4]=true;
        System.out.println(arr3.length);//arr1的长度
        System.out.println(arr3[arr3.length-1]);//输出arr1最后一个数











    }
}
